<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Gives the database a hint about the query</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="mongocursor.hasnext.html">« MongoCursor::hasNext</a></li>
      <li style="float: right;"><a href="mongocursor.immortal.html">MongoCursor::immortal »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="class.mongocursor.html">MongoCursor</a></li>
    <li>Gives the database a hint about the query</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="mongocursor.hint" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">MongoCursor::hint</h1>
  <p class="verinfo">(PECL mongo &gt;=0.9.0)</p><p class="refpurpose"><span class="refname">MongoCursor::hint</span> &mdash; <span class="dc-title">Gives the database a hint about the query</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-mongocursor.hint-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>MongoCursor::hint</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.declarations.html#language.types.declarations.mixed" class="type mixed">mixed</a></span> <code class="parameter">$index</code></span>): <span class="type"><a href="class.mongocursor.html" class="type MongoCursor">MongoCursor</a></span></div>

 </div>


 <div class="refsect1 parameters" id="refsect1-mongocursor.hint-parameters">
  <h3 class="title">Parameters</h3>
  <p class="para">
   <dl>

    
     <dt>

      <code class="parameter">index</code>
     </dt>

     <dd>

      <p class="para">
       Index to use for the query. If a string is passed, it should correspond
       to an index name. If an array or object is passed, it should correspond
       to the specification used to create the index (i.e. the first argument
       to <span class="function"><a href="mongocollection.ensureindex.html" class="function">MongoCollection::ensureIndex()</a></span>).
      </p>
     </dd>

       
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-mongocursor.hint-returnvalues">
  <h3 class="title">Return Values</h3>  
  <p class="para">
   Returns this cursor.
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-mongocursor.hint-errors">
  <h3 class="title">Errors/Exceptions</h3>
  <p class="para">
   Throws <a href="class.mongocursorexception.html" class="classname">MongoCursorException</a> if this cursor has started iterating.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-mongocursor.hint-changelog">
  <h3 class="title">Changelog</h3>
  <p class="para">
   <table class="doctable informaltable">
    
     <thead>
      <tr>
       <th>Version</th>
       <th>Description</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>PECL mongo 1.4.0</td>
       <td>
        <p class="para">
         The <code class="parameter">index</code> argument now supports index names as
         string values. In versions before 1.4.0, only array or object values
         were accepted.
        </p>
       </td>
      </tr>

     </tbody>
    
   </table>

  </p>
 </div>

</div></div></div></body></html>